import request from '@/utils/request'


// 查询商品列表
export function list(pageSize,pageNum) {
    const data = {
        pageSize,
        pageNum,
    }
    return request({
      url: '/goods/commodity/list',
      method: 'get',
      params: data
    })
  }

// 新增商品
export function add(data) {
    return request({
      url: '/goods/commodity',
      method: 'post',
      data,
    })
  }
  // 删除商品
export function del(id) {
    return request({
      url: '/goods/commodity/'+id,
      method: 'DELETE',
    })
  }
// 修改商品
export function update(data) {
    return request({
        url: '/goods/commodity',
        method: 'put',
        data
    })
    }
// 查询商品详情
export function commodity(id) {
    return request({
      url: '/goods/commodity/'+id,
      method: 'get',
    })
  }
// 搜索商品
export function inquire(data) {
    return request({
        url: '/goods/commodity/list',
        method: 'get',
        params: data
    })
}

//获取商品详细分类详细信息
export function detailed (type) {
  const data = {
    type
  }
  return request({
      url: '/goods/commodity/type/list',
      method: 'get',
      params: data
  })
}
